I want to position the image of a UITabBarItem with the imageInsets Property, but whenever I use a SystemItem or an SFSymbol as UIImage it doesn't work.
Contrary to this a normal custom image works just fine and I tried it in code and with the storyboard.
So my problem is that the position of some SFSymbols is not properly centred, is there a way to fix this?
Post
Replies
Boosts
Views
Activity
As the title suggests, I would like to push a ViewController onto the navigation stack, not full screen but as a popover, but despite setting the modalPresentationStyle to .popover at various positions I can't get it to work, it is still presented in full screen.
If I use present(vc, ani, comp) it works, but not with pushing.
For clarity, it should look like the iOS Clock or Calendar app, when you add an alarm or create a new event.
As the title suggests, I would like to push a ViewController onto the navigation stack, not full screen but as a popover, but despite setting the modalPresentationStyle to .popover at various positions I can't get it to work, it is still presented in full screen.
I the end it should be like in the Clock App, when you add an alarm.
Hello everyone,I got a question and here is a little example to demonstrate it.Lets suppose I got a class Soldier which has some typical attributes.class Soldier { var healthPoints: Int var attack: Int var defense: Int var type: SoldierType...}enum SoldierType { case ARCHER case INFANTRY case CAVALARY}Now I want to use several soldier types with different default values therefore I have two ideas:1. Subclassing the Soldier class and then providing an initializer for each type of soldier I want.e.g.class Archer: Soldier { init() { super.init() healtPoints = 100 attack = 10 defense = 2 type = .ARCHER }}...2. My second approach would be to initialize the Soldier with a type and then switch the type.init(type: SoldierType) { self.type = type switch type { case .ARCHER: healtPoints = 100 attack = 10 defense = 2 ...}I hope Iam not on a completly wrong path.If not, I would prefer the first option,but since Swift has no access modifier for the class and subclasses only, I would have to make everything private and provide setter, which I really do not like.If there are other better ways, I would be glad if you let me know.Thanks in advanceChris
Is there an easy way to detect touch only on the non transparent parts of a spritenode.I know that you can use the physicsbody of the spritenode,but isn't that way to expensive when you got hundreds of nodes in your scene.
I've found nothing regarding this topic.So does anyone know how to create a Hexagonal Tileset which works with AutoMapping ?